package nuc.lizongze.item.controller;

import nuc.lizongze.item.service.ItemCategoryService;
import nuc.lizongze.pojo.TbItemCat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/service/itemCategory")
public class ItemCategoryController {
    @Autowired
    ItemCategoryService itemCategoryService;
    /**
     * 查找商品类目,根据父id查询子id
     */
    @RequestMapping("/selectItemCategoryByParentId")
    public List<TbItemCat> selectItemCategoryByParentId(@RequestParam Long id){
        List<TbItemCat> tbItemCats = itemCategoryService.selectItemCategoryByParentId(id);
        return tbItemCats;
    }
}
